package com.snail.readyvr.util;

import com.snail.readyvr.mvp.model.DaoSession;
import com.snail.readyvr.mvp.model.VideoHistory;

import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.schedulers.Schedulers;

/**
 * Created by MRKING on 2016/11/18.
 */

public class SaveVideoHistoryUtils {
    private SaveVideoHistoryUtils(){}


    public static void saveVideo(DaoSession daoSession, VideoHistory historyVideo){
        daoSession.getVideoHistoryDao().rx().insert(historyVideo)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Action1<VideoHistory>() {
                    @Override
                    public void call(VideoHistory videoHistory) {

                    }
                });
    }

}
